#ifndef MAP_H
#define MAP_H

#include <vector>
#include <allegro5\allegro.h>
#include "Point.h"
#include "GlobalVariables.h"
#include "Bitmap.h"

using namespace std;

//! A class used to track the locations of all game objects including sand, holes and movable objects on a 2D grid
class Map
{

public:
	//!Constructor
	Map();
	//! \brief Returns the type of object located at the grid element being queried
	Movable_type positionType(Point position) const;
	//! \brief Plots specific Movable objects with a given radius, location and identity type to the game grid
	void plotMovable(Movable_type type, const Point& location, int radius);
	//! \brief Removes specific Movable objects with a given radius, location and identity type from the game grid
	void removeMovable(const Point& location, int radius);

	void set(vector<vector<Movable_type>> mp);
	
	//Get functions
	vector<vector <Movable_type>> elements();
	ALLEGRO_BITMAP *bitmap();
	//! \brief Removes all objects from the grid besides for sand and holes, irrespective of type.
	//! Useful when resetting the positions of all Movable objects.
	void Map::removeAllMovables();

private:
	//Data members
	vector<vector<Movable_type> > _screen_map;
	ALLEGRO_BITMAP *_bitmap; 
};

#endif
